|
This page last changed on Jan 02, 2007 by rosie@atlassian.com.
You need to edit in 'Wiki Markup' mode to include macros in your page.
Use the Children Display Macro to display the children and the descendants of a page.
Note that only pages to which you have 'View' permission will be displayed.
Children Display Macro
| What you need to type |
What you will get |
| {children} |
|
Optional Parameters
| No |
parameter |
Default |
Description |
| 1 |
all |
true |
Display all descendants |
| 2 |
page |
current |
Specify which page to display children for in a current space or in a different space |
| 3 |
depth |
none |
Specify the depth of descendents to display |
| 4 |
first |
none |
Restrict the number of children displayed at the top level |
| 5 |
style |
none |
Specify the style in which descendants are displayed |
| 6 |
excerpt |
false |
Display the child pages' excerpts, if they exist |
| 7 |
sort=creation sort=title sort=modification |
recent |
The 'sort' attribute is an optional attribute that allows you to configure how the children are sorted. Specify 'creation' to sort by content creation date, 'title' to sort alphabetically on title and 'modified' to sort of last modification date. |
1. Display all descendants of the page
{children:all=true}{nomarkup}
2a. Specify which page to display children for
{children:page=page name}
2b. Specify which page in a different space to display children for
{children:page=space key:page name}
3. Specify the depth of descendants
4. Restrict the number of children displayed at the top level
5. Specify the style in which descendants are displayed
Choose from heading levels h1 to h6.
{children:depth=1|style=h3}
6. Display the child pages' excerpts, if they exist
{children:depth=2|excerpt=true}
7. Sort children by creation date, modification date or title
{children|sort=creation|reverse=true}
 |
If the page parameter is '/', then the macro will list all the current space's "top level" pages – those without parents. If the page parameter is a space key followed by a
colon (e.g {children:page=DOC:}), then the top level pages of that space will be listed. |
RELATED TOPICS
Working with Page Families
Working with Macros
Take me back to Confluence 2 Home
|
It would be nice if in addition to "excerpt=true" you could do "include=true" that would include the fully rendered content of the children pages. This would simplify allowing multiple authors updating content for a single page (by breaking it up into parts, attached as childrem).

Posted by marvingreenberg at Dec 06, 2005 11:59
|
|
Will support be added so that only children with a particular label are listed?
e.g. Unable to render {children} Can only find children for a page, this is a comment

Posted by thomasvdv at Jan 10, 2006 05:51
|
|
again:
{children:label=somelabel, anotherlabel}

Posted by thomasvdv at Jan 10, 2006 05:52
|
|
Thomas,
There is already a feature request for this: http://jira.atlassian.com/browse/CONF-4645. If you would like to see this feature included in Confluence, please vote for it.
Vidya

Posted by vidya at Jan 10, 2006 18:32
|
|
Just as an FYI for anyone monitoring this page, there is a syntax error in the bullet 7 code-block. The children macro keyword ought to be followed by a colon (:), not a pipe (|).

Posted by thadras at Mar 22, 2006 11:02
|
|
Setting excerpt=true doesn't seem to work properly when the excerpt on the target page has content within the excerpt on more than one line. The children macro only shows the first line. Is this a bug? For example:
{excerpt}
Test1
Test2
{excerpt}
The children macro will only show Test1...why is this?

Posted by btknorr@gmail.com at Apr 05, 2006 11:36
|
|
It's expected behaviour - there are many macros such as {children} and {pagetree}, etc., that display excerpts and in order to ensure consistent results various things are excluded from the excerpts:
- Only the first line is shown, other lines are ignored
- Images and macros within excerpts are not displayed for aesthetic, usability and security reasons

Posted by gfraser at Apr 05, 2006 11:39
|
|
Would it be possible to make this configurable? Maybe have an option to include all the lines within an excerpt? If so, maybe we could even specify a delimiter for how multiple lines are display for the children macro. So if the delimiter is a space then the expert above would display as Test1 Test2...thoughts?

Posted by btknorr@gmail.com at Apr 05, 2006 11:47
|
|
In general I need a way to pull in the full excerpt (not just the first line) from multiple pages and list them all. I would like to use the standard "excerpt" tag, but it doesn't look like I can. I guess the meta-data plugin is the way to go.
Thanks.

Posted by btknorr@gmail.com at Apr 06, 2006 10:55
|
|
Latest addition to this macro : You can display children for pages within different wiki spaces.
*{children:page=<Spacekey>:<Page Name>}*
Following code will display output as follows:
*{children:page=*CODEGEIST*:*Atlassian Codegeist*}*
Unable to render {children} Page not found: *CODEGEIST*:*Atlassian Codegeist*

Posted by rakadam at Jul 16, 2006 16:59
|
|
You can use the Content by Label Macro instead, eg {contentbylabel:troubleshooting-faq|showLabels=false|maxResults=99|showSpace=false}

Posted by david.soul@atlassian.com at Sep 18, 2006 20:53
|
|
Hi,
Please, can you tell me where i can find the source code of this macro ?
For my confluence i wish to have the same result but with a 'add page' link next to the first level of 'children' . The parent page must be each first level.
Thks

Posted by gludenglu at Oct 12, 2006 01:11
|
|
Hi, new query...
I am keen to know, is it possible for Children Macro to know how many children are in its output.
What I am looking for is a Link only to show if the Children macro actually contains something. i.e. based on permissioning the children macro may contain a variable number of 'children', however if that value is 'zero' then there i no need to show the link at all.
There is probably another way to handle this, but I thought I would start here.

Posted by guyh@ncompass.co.uk at Oct 13, 2006 07:50
|
|
Its in the Confluence source, let me know if you need to know the specific class (it should be easy to find by searching).

Posted by david.soul@atlassian.com at Nov 08, 2006 14:43
|
|
The Content by Label macro won't work if you only want to list the pages that are children with a matching label. The Content by Label macro will list all pages that match that label for a Space or all Spaces.

Posted by david.head@honeywell.com at Dec 06, 2006 12:10
|
|
Does the children macro filter out children that are not accessible to the current user because she has no permission to read them?
If it doesn't, how easy would it be to modify the macro to take permissions into account?

Posted by u.cei@sourcesense.com at Jan 19, 2007 04:29
|
|